| Metric | Value |
|---|---|
| AIC | 10668.92 |
| AICc | 10669.06 |
| BIC | 10778.65 |
| R2 (cond.) | 0.19 |
| R2 (marg.) | 0.18 |
| ICC | 0.01 |
| RMSE | 0.74 |
| Sigma | 0.74 |
For interpretation of performance metrics, please refer to this documentation.
| Parameter | Coefficient | SE | 95% CI | t(4680) | p |
|---|---|---|---|---|---|
| (Intercept) | 1.36 | 0.09 | (1.17, 1.54) | 14.47 | < .001 |
| desigualdad apod | 0.03 | 0.01 | (5.67e-03, 0.05) | 2.49 | 0.013 |
| esfuerzo esc | 0.01 | 0.02 | (-0.02, 0.05) | 0.72 | 0.470 |
| inteligencia esc | 0.03 | 0.01 | (1.58e-04, 0.05) | 1.97 | 0.049 |
| esfuerzo soc | 0.08 | 0.02 | (0.04, 0.12) | 4.27 | < .001 |
| merito soc | 0.11 | 0.02 | (0.08, 0.15) | 6.07 | < .001 |
| inteligencia soc | 0.26 | 0.02 | (0.23, 0.30) | 14.49 | < .001 |
| educacion rec [Educación secundaria] | 0.07 | 0.04 | (-0.02, 0.15) | 1.56 | 0.119 |
| educacion rec [Educación técnica] | 0.05 | 0.05 | (-0.05, 0.14) | 1.01 | 0.313 |
| educacion rec [Universidad o postgrado] | 0.12 | 0.05 | (0.02, 0.21) | 2.30 | 0.021 |
| educacion rec [Ns/Nr] | 0.09 | 0.04 | (1.98e-03, 0.17) | 2.01 | 0.045 |
| cod depe2 [Part. subvencionado] | 2.53e-03 | 0.03 | (-0.06, 0.06) | 0.08 | 0.936 |
| cod depe2 [Part. privado] | 0.01 | 0.06 | (-0.10, 0.13) | 0.22 | 0.826 |
| cod grupo rec [Medio] | 0.04 | 0.04 | (-0.03, 0.11) | 1.02 | 0.306 |
| cod grupo rec [Alto] | 0.16 | 0.04 | (0.08, 0.24) | 4.04 | < .001 |
| Parameter | Coefficient |
|---|---|
| SD (Intercept: mrbd) | 0.08 |
| SD (Residual) | 0.74 |
To find out more about table summary options, please refer to this documentation.
| desigualdad_apod | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| -1.03 | 0.00 | 2.69 | ||
| 0.02 | 0.00 | 2.71 | ||
| 1.06 | 0.00 | 2.74 | ||
| 2.10 | 0.00 | 2.77 | ||
| 3.14 | 0.00 | 2.80 | ||
| 4.18 | 0.00 | 2.82 | ||
| 5.22 | 0.00 | 2.85 | ||
| 6.26 | 0.00 | 2.88 | ||
| 7.30 | 0.00 | 2.91 | ||
| 8.34 | 0.00 | 2.94 |
Variable predicted: desigualdad
Predictors modulated: desigualdad_apod
Predictors controlled: esfuerzo_esc (3.7), inteligencia_esc (3), esfuerzo_soc (2.7), merito_soc (2.6), inteligencia_soc (2.7), educacion_rec (1), cod_depe2 (1), cod_grupo_rec (1)
| esfuerzo_esc | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| 1.28 | 0.00 | 2.76 | ||
| 1.88 | 0.00 | 2.77 | ||
| 2.48 | 0.00 | 2.78 | ||
| 3.08 | 0.00 | 2.79 | ||
| 3.68 | 0.00 | 2.80 | ||
| 4.28 | 0.00 | 2.81 | ||
| 4.88 | 0.00 | 2.81 | ||
| 5.48 | 0.00 | 2.82 | ||
| 6.08 | 0.00 | 2.83 | ||
| 6.68 | 0.00 | 2.84 |
Variable predicted: desigualdad
Predictors modulated: esfuerzo_esc
Predictors controlled: desigualdad_apod (3.1), inteligencia_esc (3), esfuerzo_soc (2.7), merito_soc (2.6), inteligencia_soc (2.7), educacion_rec (1), cod_depe2 (1), cod_grupo_rec (1)
| inteligencia_esc | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| -0.32 | 0.00 | 2.71 | ||
| 0.51 | 0.00 | 2.73 | ||
| 1.34 | 0.00 | 2.75 | ||
| 2.17 | 0.00 | 2.77 | ||
| 3.01 | 0.00 | 2.80 | ||
| 3.84 | 0.00 | 2.82 | ||
| 4.67 | 0.00 | 2.84 | ||
| 5.50 | 0.00 | 2.86 | ||
| 6.33 | 0.00 | 2.89 | ||
| 7.16 | 0.00 | 2.91 |
Variable predicted: desigualdad
Predictors modulated: inteligencia_esc
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), esfuerzo_soc (2.7), merito_soc (2.6), inteligencia_soc (2.7), educacion_rec (1), cod_depe2 (1), cod_grupo_rec (1)
| esfuerzo_soc | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| -0.69 | 0.00 | 2.52 | ||
| 0.16 | 0.00 | 2.59 | ||
| 1.00 | 0.00 | 2.66 | ||
| 1.85 | 0.00 | 2.73 | ||
| 2.69 | 0.00 | 2.80 | ||
| 3.54 | 0.00 | 2.87 | ||
| 4.39 | 0.00 | 2.94 | ||
| 5.23 | 0.00 | 3.01 | ||
| 6.08 | 0.00 | 3.08 | ||
| 6.92 | 0.00 | 3.15 |
Variable predicted: desigualdad
Predictors modulated: esfuerzo_soc
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), inteligencia_esc (3), merito_soc (2.6), inteligencia_soc (2.7), educacion_rec (1), cod_depe2 (1), cod_grupo_rec (1)
| merito_soc | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| -0.81 | 0.00 | 2.41 | ||
| 0.04 | 0.00 | 2.51 | ||
| 0.89 | 0.00 | 2.60 | ||
| 1.75 | 0.00 | 2.70 | ||
| 2.60 | 0.00 | 2.80 | ||
| 3.45 | 0.00 | 2.89 | ||
| 4.30 | 0.00 | 2.99 | ||
| 5.16 | 0.00 | 3.09 | ||
| 6.01 | 0.00 | 3.18 | ||
| 6.86 | 0.00 | 3.28 |
Variable predicted: desigualdad
Predictors modulated: merito_soc
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), inteligencia_esc (3), esfuerzo_soc (2.7), inteligencia_soc (2.7), educacion_rec (1), cod_depe2 (1), cod_grupo_rec (1)
| inteligencia_soc | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| -0.67 | 0.00 | 1.91 | ||
| 0.17 | 0.00 | 2.13 | ||
| 1.02 | 0.00 | 2.35 | ||
| 1.86 | 0.00 | 2.58 | ||
| 2.70 | 0.00 | 2.80 | ||
| 3.55 | 0.00 | 3.02 | ||
| 4.39 | 0.00 | 3.24 | ||
| 5.24 | 0.00 | 3.46 | ||
| 6.08 | 0.00 | 3.68 | ||
| 6.93 | 0.00 | 3.91 |
Variable predicted: desigualdad
Predictors modulated: inteligencia_soc
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), inteligencia_esc (3), esfuerzo_soc (2.7), merito_soc (2.6), educacion_rec (1), cod_depe2 (1), cod_grupo_rec (1)
| educacion_rec | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| 8vo grado o menos | 0.00 | 2.80 | ||
| Educación secundaria | 0.00 | 2.87 | ||
| Educación técnica | 0.00 | 2.85 | ||
| Universidad o postgrado | 0.00 | 2.91 | ||
| Ns/Nr | 0.00 | 2.89 |
Variable predicted: desigualdad
Predictors modulated: educacion_rec
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), inteligencia_esc (3), esfuerzo_soc (2.7), merito_soc (2.6), inteligencia_soc (2.7), cod_depe2 (1), cod_grupo_rec (1)
| cod_depe2 | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| Municipal | 0.00 | 2.80 | ||
| Part. subvencionado | 0.00 | 2.80 | ||
| Part. privado | 0.00 | 2.81 |
Variable predicted: desigualdad
Predictors modulated: cod_depe2
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), inteligencia_esc (3), esfuerzo_soc (2.7), merito_soc (2.6), inteligencia_soc (2.7), educacion_rec (1), cod_grupo_rec (1)
| cod_grupo_rec | mrbd | Predicted | SE | 95% CI |
|---|---|---|---|---|
| Bajo | 0.00 | 2.80 | ||
| Medio | 0.00 | 2.84 | ||
| Alto | 0.00 | 2.96 |
Variable predicted: desigualdad
Predictors modulated: cod_grupo_rec
Predictors controlled: desigualdad_apod (3.1), esfuerzo_esc (3.7), inteligencia_esc (3), esfuerzo_soc (2.7), merito_soc (2.6), inteligencia_soc (2.7), educacion_rec (1), cod_depe2 (1)
We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with desigualdad_apod (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to desigualdad_apod = 0, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with esfuerzo_esc (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to esfuerzo_esc = 0, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with inteligencia_esc (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to inteligencia_esc = 0, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with esfuerzo_soc (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to esfuerzo_soc = 0, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with merito_soc (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to merito_soc = 0, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with inteligencia_soc (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to inteligencia_soc = 0, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with educacion_rec (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to educacion_rec = 8vo grado o menos, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation., We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with cod_depe2 (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to cod_depe2 = Municipal, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation. and We fitted a linear mixed model (estimated using REML and nloptwrap optimizer) to predict desigualdad with cod_grupo_rec (formula: desigualdad ~ 1 + desigualdad_apod + esfuerzo_esc + inteligencia_esc + esfuerzo_soc + merito_soc + inteligencia_soc + educacion_rec + cod_depe2 + cod_grupo_rec). The model included mrbd as random effect (formula: ~1 | mrbd). The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18. The model’s intercept, corresponding to cod_grupo_rec = Bajo, is at 1.36 (95% CI (1.17, 1.54), t(4680) = 14.47, p < .001). Within this model:
Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using a Wald t-distribution approximation.
The model’s total explanatory power is moderate (conditional R2 = 0.19) and the part related to the fixed effects alone (marginal R2) is of 0.18
---
title: "Regression model summary from `{easystats}`"
output:
flexdashboard::flex_dashboard:
theme:
version: 4
# bg: "#101010"
# fg: "#FDF7F7"
primary: "#0054AD"
base_font:
google: Prompt
code_font:
google: JetBrains Mono
params:
model: model
check_model_args: check_model_args
parameters_args: parameters_args
performance_args: performance_args
---
```{r setup, include=FALSE}
library(flexdashboard)
library(easystats)
# Since not all regression model are supported across all packages, make the
# dashboard chunks more fault-tolerant. E.g. a model might be supported in
# `{parameters}`, but not in `{report}`.
#
# For this reason, `error = TRUE`
knitr::opts_chunk$set(
error = TRUE,
out.width = "100%"
)
```
```{r}
# Get user-specified model data
model <- params$model
# Is it supported by `{easystats}`? Skip evaluation of the following chunks if not.
is_supported <- insight::is_model_supported(model)
if (!is_supported) {
unsupported_message <- sprintf(
"Unfortunately, objects of class '%s' are not yet supported in {easystats}.\n
For a list of supported models, see `insight::supported_models()`.",
class(model)[1]
)
}
```
Model fit
=====================================
Column {data-width=700}
-----------------------------------------------------------------------
### Assumption checks
```{r check-model, eval=is_supported, fig.height=10, fig.width=10}
check_model_args <- c(list(model), params$check_model_args)
do.call(performance::check_model, check_model_args)
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
Column {data-width=300}
-----------------------------------------------------------------------
### Indices of model fit
```{r, eval=is_supported}
# `{performance}`
performance_args <- c(list(model), params$performance_args)
table_performance <- do.call(performance::performance, performance_args)
print_md(table_performance, layout = "vertical", caption = NULL)
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
For interpretation of performance metrics, please refer to <a href="https://easystats.github.io/performance/reference/model_performance.html" target="_blank">this documentation</a>.
Parameter estimates
=====================================
Column {data-width=550}
-----------------------------------------------------------------------
### Plot
```{r dot-whisker, eval=is_supported}
# `{parameters}`
parameters_args <- c(list(model), params$parameters_args)
table_parameters <- do.call(parameters::parameters, parameters_args)
plot(table_parameters)
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
Column {data-width=450}
-----------------------------------------------------------------------
### Tabular summary
```{r, eval=is_supported}
print_md(table_parameters, caption = NULL)
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
To find out more about table summary options, please refer to <a href="https://easystats.github.io/parameters/reference/model_parameters.html" target="_blank">this documentation</a>.
Predicted Values
=====================================
Column {data-width=600}
-----------------------------------------------------------------------
### Plot
```{r expected-values, eval=is_supported, fig.height=10, fig.width=10}
# `{modelbased}`
int_terms <- find_interactions(model, component = "conditional", flatten = TRUE)
con_terms <- find_variables(model)$conditional
if (is.null(int_terms)) {
model_terms <- con_terms
} else {
model_terms <- clean_names(int_terms)
int_terms <- unique(unlist(strsplit(clean_names(int_terms), ":", fixed = TRUE)))
model_terms <- c(model_terms, setdiff(con_terms, int_terms))
}
text_modelbased <- lapply(unique(model_terms), function(i) {
grid <- get_datagrid(model, at = i, range = "grid", preserve_range = FALSE)
estimate_expectation(model, data = grid)
})
ggplot2::theme_set(theme_modern())
# all_plots <- lapply(text_modelbased, function(i) {
# out <- do.call(visualisation_recipe, c(list(i), modelbased_args))
# plot(out) + ggplot2::ggtitle("")
# })
all_plots <- lapply(text_modelbased, function(i) {
out <- visualisation_recipe(i, show_data = "none")
plot(out) + ggplot2::ggtitle("")
})
see::plots(all_plots, n_columns = round(sqrt(length(text_modelbased))))
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
Column {data-width=400}
-----------------------------------------------------------------------
### Tabular summary
```{r, eval=is_supported, results="asis"}
for (i in text_modelbased) {
tmp <- print_md(i)
tmp <- gsub("Variable predicted", "\nVariable predicted", tmp)
tmp <- gsub("Predictors modulated", "\nPredictors modulated", tmp)
tmp <- gsub("Predictors controlled", "\nPredictors controlled", tmp)
print(tmp)
}
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
Text reports
=====================================
Column {data-width=500}
-----------------------------------------------------------------------
### Textual summary
```{r, eval=is_supported, results='asis', collapse=TRUE}
# `{report}`
text_report <- report(model)
text_report_performance <- report_performance(model)
gsub("]", ")", gsub("[", "(", text_report, fixed = TRUE), fixed = TRUE)
cat("\n")
gsub("]", ")", gsub("[", "(", text_report_performance, fixed = TRUE), fixed = TRUE)
```
```{r, eval=!is_supported}
cat(unsupported_message)
```
Column {data-width=500}
-----------------------------------------------------------------------
### Model information
```{r, eval=is_supported}
model_info_data <- insight::model_info(model)
model_info_data <- datawizard::data_to_long(as.data.frame(model_info_data))
DT::datatable(model_info_data)
```
```{r, eval=!is_supported}
cat(unsupported_message)
```